package com.bdqn.t350.ch06.service.imp;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.bdqn.t350.ch06.bean.User;
import com.bdqn.t350.ch06.mapper.UserMapper;
import com.bdqn.t350.ch06.service.UserService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class UserServiceImp implements UserService {

    @Resource
    UserMapper userMapper;

    @Override
    public List<User> selectList(QueryWrapper queryWrapper) {
        return userMapper.selectList(queryWrapper);
    }

    @Override
    public IPage<User> selectPage(IPage<User> page, QueryWrapper queryWrapper) {
        return userMapper.selectPage(page, queryWrapper);
    }

    @Override
    public int insert(User user) {
        return userMapper.insert(user);
    }

    @Override
    public int deleteById(int id) {
        return userMapper.deleteById(id);
    }

    @Override
    public int updateById(User user) {
        return userMapper.updateById(user);
    }
}
